Okay so today we are going to start learning scripting.
Okay.
So um, if you don't know what scripting is used for already, um, basically, if you want to change
something in your game without you doing it, most of the time it's a script.
Okay.
So for example, if you want to, um, make a leaderboard, okay, that's going to be constantly changing.
So you need to script that if you want to make a, um, a welcome screen or a, a main menu to your
game, you need to code that.
So when they click a button, a button, um, you can join the game or go over to whatever setting.
So most parts, um, a lot of parts of games involve coding, okay.
And we code inside of scripts.
So if you've watched the first section already, you now have a very good understanding of how to build
things in Roblox studio.
Okay.
But the second part is just as important as that, which is the scripting.
Okay.
Um, because I can guarantee you you are not going to be able to make a decent game.
You're not going to be able to make a good game without learning scripting.
Okay?
Now some people find this, um, quite scary, but it's it's really simple when you break it down and
I'll be going through this all in steps, so it's all okay.
Um, so first off we're going to add another tab onto our screen okay.
So go over to view and you want to find the output tab which is let's try and find it just here okay.
So it's the second column down just over here.
And I want you to left click that.
And I want you to you I want you to put it down on the bottom there.
So this icon we looked at last time with the explore in the properties tab, put that down on the bottom
and let go okay.
So output tab should be here.
Or put it out of place okay.
And you can adjust the height of it.
Should be able to adjust the height of it.
There we go.
So what is the output tab used for.
Well it displays very important information when it comes to scripting okay.
If you make a mistake in one of your scripts it will tell you the mistake in the output.
It also tells you things like when a vocabulary file for your game has been created.
So if you use some of your progress, you can open up a recovery file and other things like that.
So it is very useful to have open.
But most of its uses do come with scripting.
Okay.
So now we know that.
Let's have a look at how to start scripting okay.
So we code in scripts.
Now there are three types of script.
You have your normal scripts which are just called scripts.
You have local scripts and you have module scripts.
Let's add all these in.
So let's go to the workspace.
Click the plus and search up for a script.
Search a local script and search for a module script.
And you can see they appear in windows here.
So you can click each one just like that to go between your free scripts.
Or you can also double click the individual scripts in the explorer to open them.
And if you want to go back to your game, you just click on the name of your game, which I just have
the basic as base plate.
Okay, so let's explain why there are three different types of script okay.
So first off module scripts.
Let's ignore those for now okay.
Um, module scripts we're not even going to touch on in this section of the course.
Um, they do have their uses of course, but they are not used nearly as much as your standard scripts.
Okay.
So we will look at those later on.
So let's just forget about module scripts for now okay.
Um, so scripts and local scripts um, they are very similar.
Okay.
Most of the code you could write in a script, you can also write in a local script.
And same goes for any code you can write in a local script.
Most of it you can also write in a script.
There are some key differences though.
Um, the main difference is how it how it works.
Okay, so there are two parts of your game actually working, um, which is clients and your server.
Okay.
So your server Roblox controls, they are your servers which you can join.
And on each on each server you have all your players.
Okay.
Um, so when you code on the server.
Um, everybody sees the server and everybody sees the same server.
So when you code on the server, everybody sees that change.
So everybody can see what you're coding on there.
Okay.
So when you want something to happen for all players at the same time, you want to be using a script.
Or I might call them server scripts because they do stuff on the server.
Okay.
Um, local scripts do things on the client.
The client is your player.
Okay.
When you code on the client, you are coding something that just happens for specific players, okay.
At certain times.
So it makes sense if you think about it.
Because if you want to code a weather system that makes it rain, snow, cloudy, sunny, um, you want
everybody to see that at the same time.
Would it make sense if one player it's for one player it's sunny.
Never played a player.
It's raining, so it wouldn't make any sense.
So that's why you would use a server script or a normal script for that.
However, if you want to code an inventory system so you can open up your inventory and equip a weapon,
um, you don't want to use a script for that, because if you if you tried, if it worked, it doesn't
work.
But if you tried to, um, it would mean that when one player, one person wants to open their inventory,
everybody has to open the inventory.
And then one player equips a weapon and everybody has to equip that same weapon if they even have it.
Okay.
So that's why it's very important.
There's two types of script depending on what you're wanting to do.
Okay.
Now we will be focusing on just normal server scripts for the first bit.
But we will touch into local scripts a bit later on.
Okay so let's get rid of our local script for now.
One more thing before we get on to actual coding.
Next lesson.
Okay, um, is about testing the game.
So we've touched on this a bit in the previous section, but haven't really explained too much because
it's more of a scripting concept.
Um, because I wanted you to know what what the server and what the client is first.
So you can test the game in the home section and test is just over here.
There's a button called play.
You can click this drop down and also play here and run the game.
So play just loads your character in okay play here.
Load your character in where your camera currently is and then run is something we haven't done before.
But when you run the game, it plays the game normally, but your character is not there.
Now the reason why I waited to explain to you this to you is because, um, really, when you're running
the game, you're just running the server, okay?
This is what what is what's happening at the server?
This is what the server sees but don't see players.
They don't see your player's screen.
It's just the server.
Okay.
Um, but when you play the game, you are running both the server and a client.
Okay.
Um.
The client, my player here, we can see, um, things like the leaderboard, the chats, this menu
there Pacific.
Just to me.
Okay.
But I can also see the server that everybody else sees.
Okay.
So to recap, playing the game plays both the server and the client.
And running in the game just runs the server.
And the reason why you might just want to run the server is because it can simplify things when you're
coding.
Um, and it's also much quicker to do.
Okay.
So there are some basics that you need to know in order to start scripting okay.
So make sure you understand those.
And next lesson we will start off writing some actual code.
And we're going to start off with printing and warning.
And we'll continue on from there.